This is how Megatron infects Rarity with Dark Energon goes in One Shall Fall.
[We see Bumblebee and Rarity in the desert]
Megatron: Optimus and Twilight.
Optimus Prime: Megatron, do you not see the folly in trying to force a prophecy to fruition?
Twilight Sparkle: You need to stop this.
Megatron: Why leave matters to fate if one can forge one's own destiny? Ah, speaking of fate.
[Bumblebee arrives holding the infected Rarity. Optimus and Twilight look at him. Rarity moans as Arcee looks at her]
Arcee: Rarity! She's breathing. Barely.
Rainbow Dash: Hang in there, girl.
Megatron: [laughs] It would seem I swatted a Bee and squashed a bug.
[Bumblebee gets angry and prepares to shoot Megatron when Bulkhead grabs him]
Bulkhead: Bee, no!
Applejack: Don't do it, you'll hurt Rarity!