One thing I practice during a main is to play a mental game on anybody infront of me. Let's say you're in second place, one second behind the leader. 5 laps go by and you're a few tenths of a second behind him. Most people would think this is the right time to make a move, but it really isn't. Going aggressive isn't always the best idea if the pack is close, as you could just wreck and drop spots. I would only go aggressive if there was virtually no time left.
If you believe you are faster than the leader, wait for an opening. Nobody is a perfect driver, and a mistake will eventually let you see an opportunity of a pass by this. It'd probably be less costly than an aggressive pass, seeing as those have the tendency to cause mistakes.