In ORAS, Skarmory can learn Stealth Rocks as a tutor move, but in XY, Skarmory can only learn Stealth Rocks by breeding and, as you pointed out, no Pokémon in the same egg group as Skarmory can learn it. The only way to have Skarmory with Stealth Rocks in XY would either be for it to learn it from another game's tutor, or to transfer a Pokémon from Gen 4/5 that knows it and can breed with Skarmory.