He is a descendant of Optimus Prime from Cybertron's future. He lead a spin-off of the Autobots called the Maximals.
They ended up on prehistoric Earth in their mission to stop the plans of a new Megatron; go back in time to long before the Autobots and Decepticons woke up on Earth to change the future in the Cons' favor.
Naturally the plan failed thanks to Primal's efforts to stop him, but Megatron ended up escaping Maximal custody on a flight back to Cybertron, causing the dystopia story of Beast Machines.
He was born a young man on Cybertron named Orion Pax, but a near-fatal injury from Megatron forced him to Alpha Trion's emergency room. No other alternative to save him, A3 rebuilt Pax as Cybertron's newest hero, Optimus Prime. The end result sent Decepticons running for their lives.