This is how The Decepticons learn of Equestria goes in More Than Meets The Eye Part 1.
[Wheeljack, Bumblebee, and the ponies arrive at Iacon]
Wheeljack: Well, here we are, Equines. Welcome to your new home.
[The ponies gasp in awe. Jazz arrives and transforms to robot mode]
Optimus Prime: It seems we have visitors.
Jazz: That's right.
Optimus Prime: Welcome to Cybertron, Equines. I am Optimus Prime. Leader of the Autobots.
Prowl: I'm Prowl and that's Jazz.
Optimus Prime: State your name, royal Equine.
Twilight Sparkle: My name is Twilight Sparkle. We come from Equestria, a land filled with magic, harmony and friendship. Me and my friends often use the magic of friendship in most situations.
Pinkie Pie: That's right. Every time a bad guy or villain attacks, we shoot out magic rainbow lasers.
Twilight Sparkle: Yes. Alright. Thank you, Pinkie.
Optimus Prime: We must hear more about where you come from.
[Unknown to them, Starscream and Soundwave have been listening the entire time]
Starscream: Did you record all what they said about this "Equestria", Soundwave?
Soundwave: Indeed. Every single word.
Starscream: Then we must report to Megatron immediately.
[At Kaon, Megatron has heard the news]
Megatron: A planet filled with raw energy called magic?
Starscream: Indeed my liege.
Soundwave: I heard ever single word.
Megatron: Then we must get there first. [turns to Shockwave] Shockwave!
Shockwave: What is your command, Megatron?
Megatron: You are to stay behind. I entrust Cybertron to you, Shockwave.
Shockwave: As you command.
Megatron: Starscream, prepare the troops for departure.
Starscream: But it could take days and nights to get there.
Megatron: Never. Never. Prepare for blastoff.