You did it perfectly
Basicly instead of putting it in daycare or feeding it rare candies you train it against certain pokes that give boosts to stats.
for every 4 EV points you get you go up 1 point on that stat when you level up. But you can only get like 252 EVs for each stat and 500 something in total!