To start out, find the maximum and minimum Speed stat of your Pokemon while taking into account its Speed IV, and take a look at the area of Pokemon that you can outspeed, then plan your EVs accordingly.
Want an example? Let's say we have a Calm Chinchou with a Speed IV of 31. With 0 Speed EVs, it reaches a
Speed of 146. If you give it 252 Spd EVs, it reaches 233. This means you can never outspeed a maximum Speed
Cranidos under normal conditions, but you can decide what threats you want it to outspeed between Pokemon with
a Speed stat between 146 and 233.
To factor in Agility, Rock Polish, Swift Swim, etc., simply multiply your Speed stat by the number specified to find
the Speed stat the Pokemon will have after the boost. Meaning if you wish to outspeed a Pupitar with a Speed of 138
after it uses Dragon Dance, you will need a Pokemon with a Speed of at least 208 (138 x 1.5 +1).