In the G1 series, we can see there that the Autobots have blue eyes while the Decepticons have red eyes. Even in the movies they apply the same concept. So what is the meaning of these colors?
That's a part of Good Colors, Evil Colors trope. It used to be "black means evil, white means good" in the past but due to many reason like different cultures, race and complexity etc it got changed.
Take Star Wars into consideration, good guy lightsaber was blue, bad guy had red lightsaber, (we did got more colours later), same happens in many other franchise, this colour differentiation also makes it easy who to cheer for.
There is an interesting blog about this:
Someway into Season 1, it dawned on me that all Autobots have blue eyes and all Decepticons have red eyes. I could differentiate the good from the bad by their insignias and by their eye colour as well.
This consistency is singularly one of the most beautiful G1 ideas to me. I love the consistency; I also love the consistency of Autobots having yellow gunfire and yellow based equipment and the Decepticons having pink gunfire and purple based equipment, but I digress.
The Blue-eyed Autobots & Red-eyed Decepticons (BEA + RED) idea became one of the most significant elements of the Season 2 episode Attack of the Autobots. The impact of that episode, to me, resonates till this day- when an Autobot turns evil, his eye colour changes to red.
In the film series they kept it same for Autobots and Decepticons but for other Transformer they had other colours too which might be bit confusing and explained in this video below:
While it's probably for that 'blue eyes mean good guys and red eyes mean bad guy' concept, there have been transformers f who don't necessary follow that rule.
During both Robots in Disguise (2001) and Armada, when Optimus Prime goes into his super mode, his eyes are red. And during the Unicron Trilogy, his eyes are yellow. Leobreaker (who is an Autobot) have red eyes. Jetfire and Red Alert have red visors. Vector Prime has red eyes.
In Beast Wars, almost all Maximals (Good robots) have red eyes.
Megatron (Cybertron) has blue eyes. Gas Skunk and Slapper (2001 Robots in disguise) have blue eyes.