How do you train IVs?
IVs cannot be trained and are assigned to your Pokémon when you obtain them. They are a scale from 0 - 31, with 31 being perfect. These cannot be altered so you'll have to deal with the unfortunate downsides of having lesser IVs. As your team suggests, your 3 legendary Pokémon will have 3 perfect IVs. These are random unfortunately.
How do you train EVs?
EVs can be trained and the process is relatively simple in XY. The total amount of EVs any Pokémon can obtain is 510, However it only increases stats in multiples of 4. The most common EV "spreads" are 252/252/4 which yields the maximum amount of increase for 2 stats and a small boost in another. If you want a better and faster experience you will need Power Items, which are obtained from the Battle Maison in Kiloude City
Each power item will increase the EVs you will obtain from any battle by 4. If you defeat an enemy which yields 1 Attack EV and hold the Power Bracer, you will receive 5 Attack EVs. The Power Items and the stats they increase are as follows:
Power Bracer - Attack
Power Weight - HP
Power Belt - Defense
Power Lens - Sp. Attack
Power Band - Sp. Defense
Power Anklet - Speed
5 EVs doesn't sound like a lot. You'd need to do around 51 Pokémon encounters to get full EVs. Not to mention, your Pokémon will likely already have full EVs as you've used them throughout the game. To reset your EVs, you should use a Reset Bag from Super Training. Simply tap the training bag on the bottom screen and a random bag will eventually pop out. If it happens to be a Reset Bag, just train your Pokémon by tapping the bag until it resets the EVs. A good way to train your EVs is to use Horde Battles. Horde Battles have 5 Pokemon, which means you will receive a massive 25 EVs, assuming you have the corresponding Power item to the EV yield of the Horde Pokémon. Horde Battles can be triggered by using Honey or the move Sweet Scent. The move is the better option, as it can be used over and over. Mawile is a good choice, as it learns Sweet Scent at Level 17 in Generation 6. This previous question has a great answer which details spots you should use. With 5 Pokémon with 1 EV each, you will be able to full train a Pokémon in just 10 fights. You will then need to defeat a final Pokémon to access the full EV total (10 Horde Battles is 250 EVs, just 2 short of the goal)
EDIT: I neglected to mention Pokérus, an ailment which grants your Pokémon double the EVs given for every faint. In Horde Battles, this means a monstrous 50 EVs per battle, shortening the time to just 5 Horde Battles required. Pokérus is unfortunately extremely rare. More rare than a Shiny Pokémon. For context, in Generation 6 a shiny Pokémon has a rarity of approximately 1/4096. Pokérus has a 3 in 65,536 or approximately a 1 in 21,845 chance of being generated on one of your Pokémon after a battle. That's almost 5x rarer! However, do not fret. You will likely find Pokérus much faster by trading online, where people seem to trade away inflicted Pokémon they have no use for. If a Pokémon with Pokérus has a "PKRS" symbol, it can spread to other Pokémon. You'll want this to happen, as more Pokérus is never a bad thing. If all you see is a pink smiley face, it means your Pokémon is "cured". This only happens if your Pokémon remains in your party for more than a day or so. Try to keep at least one Pokémon in the PC that has active Pokérus, so you can always spread it to a desired Pokémon
Hope this helps!