Son: Dad, where do Transformers come from?
Me: The planet of Cybertron.
Son: Who made the Transformers?
Me: Transformers make each other. Remember how Wheeljack and Ratchet made the Dinobots?
Son: But who made the first Transformer?
According to Transformer's Wiki - Transformer Origin there are quite a few different origin theories that derive from different continuities, and not all continuities give a specific race species origin.
Some of these are:
- Atechnogenesis - Spontaneous evolution from simpler machines on Cybertron. Origin, 1st comic, but appears to have been largely abandoned.
- Quintesson made - Created by an alien race (Quintesson) as goods and weapons on Cybertron while used as a factory for a larger empire. Origin, 1st gen cartoon series, but appears to be reconciled and retconned with Primus theory.
- Primus created - The Lord of Light (Primus) created them to battle the forces of the dark god Unicron. Origin, UK series but carried back to most future continuities 2007-2010. Apparently a retcon for earlier works was also devised to use this origin.
- Cube Creationism - The AllSpark mystically created the transformers race. Origin, live action movies and Transformers Animated circa 2007
- Hybrid of Cube Creationism with Primus as creator - Unifying theory whereby Primus remains the creator and the AllSpark is the tool he used to create them.
*Note: these points are taken from the above cited source, but paraphrased for brevity. Additional details available at said source.
In the G1 cartoon and movie, the Transformers are created by the Quintessons, another robot-like species. They created the Autobots as laborers and the Decepticons as their military.
The origin in the comics and subsequent series differs, but here is one of the more accepted/referenced ones: Primus is brother to Unicron. Both Primus and Unicron were originally more traditionally formed beings (arms, legs, head, etc), but after a battle on the astral plane, they were both left in the forms of planetoids. Over time, they were both able to alter their forms into large metal planets. As more time passed, Unicron was able to transform himself between his planet form and his giant robot form. To battle him, Primus created beings with Unicron's ability to transform themselves. These new beings would live on him. Primus would come to be known as Cybertron and the beings as the Transformers.
From the Transformers wikia, the Marvel Comics timeline:
Either way, Primus could only win by tricking Unicron into trapping his spirit in a barren asteroid — Primus was trapped in a second. Unicron turned his into a new body, Primus turned his into the planet Cybertron and birthed the Transformers to battle Unicron in his place. The Transformers were led by Prima, the first bearer of the Primus-born Matrix of Leadership.
Beast Wars appears to be a continuation of the G1 television series.
In the movie timeline, it was the Allspark cube.
In the TV universe, the Transformers were created by the Quintessons. They showed up in the TV episodes that came out after Transformers: The Movie.
The All-Spark created Primus and Unicron, the first transformers, since it was the source of all life. Primus, at the beginning of time, battled Unicron and won. All good forces come from Primus to this day, such as the Autobots. The bad forces come from Unicron, the Decepticons being an example. In my opinion, the creator Primus should not be overlooked. He is goodness personified. That is all!