This is how Optimus and Twilight merge with Primus and Thomas' new mission goes in Thomas and Friends: Transformers Prime: Friendship is Magic: Beast Hunters: Predacons Rising.
[Optimus turns to the others]
Optimus Prime: In order to both protect the Allspark and secure Unicron's defeat, it was necessary for me to empty the vessel's contents.
Twilight Sparkle: As it was for me.
Bumblebee: Into where?
Rarity: Where did they get emptied?
Optimus Prime: The Matrix of Leadership and Twilight's horn. As such, my own Spark can no longer be separated from the multitude of others within me. And the very same thing has happened to Twilight.
Twilight Sparkle: There was no other choice.
Ratchet: Are you telling us that you and Twilight are now one with the Allspark?
Smokescreen: That's what you say when someone kicks the... [stops]
Pinkie Pie: Twilight...
Optimus Prime: To not return the Allspark to the well would be to prevent future generations of new life from existing on Cybertron. Our quest must be completed.
Twilight Sparkle: You must continue spreading friendship.
Ratchet: Optimus, I didn't return to save a life only to lose the one I care most about.
Fluttershy: And I didn't return to make sure everyone was fine just to lose the one princess we love.
Bulkhead: Ratchet's restored planets. He'll find a way to save you and Twilight!
Arcee: We can turn to Vector Sigma, just like we did before.
Rainbow Dash: She is right.
Optimus Prime: Because the Matrix must now be relinquished with the Allspark, it cannot be restored or passed down to another. But while this may very well mark the end of the age of Primes, leadership can be earned with or without the Matrix, and, in my view... you have each acted as a Prime.
Twilight Sparkle: And all of you have shown different signs of friendship.
Knock Out: Well, I never really had the best role models.
Optimus Prime: As even Megatron has demonstrated on this day, every sentient being possesses the capacity for change. I ask only this of you, fellow Autobots keep fighting the noblest of fights.
Twilight Sparkle: And try to keep friendship running, girls.
Bumblebee: You can count on us to keep the peace.
Rarity: Good luck, darlings. Keep friendship in the underworld alive.
[Optimus and Twilight smile before flying into the well]
[Thomas, his friends, the Autobots, the Mane Five, and Knock Out watch]
[Starlight and Megatron look on]
[In the well, Optimus opens his chest to reveal the Matrix and Twilight's horn glows]
Optimus Prime: (voice) Above all do not lament our absence.
[They merge with Primus]
Optimus Prime: (voice) For in my spark and Twilight's heart, I know that this is not the end.
[Sparks fly out]
Optimus Prime: (voice) But merely a new beginning.
[A spark and heart appear, revealing them to be Optimus' spark and Twilight's heart]
Optimus Prime: (voice) Simply put another transformation and friendship.
[The film ends]