The equation is simple
Steven Spielberg + hot chick + US Military + rather good movie music + reasonable script
An poorly contrived origin story to go with toys cars that fold like origami into anthropomorphic robots
= a better movie that I was expecting.
Military movies are at their best when fighting hostile aliens. The all time classic is still Star Ship Troopers, movie and book version. Transformers the movie can now join as near equals in the sub-genre. If only Heinlein was a writer for Hasbro when they needed a story for sentient alien robots.
The movie did have a small political message–the president in the movie was not portrait favorably, while the top guy in the military was a hero that participated in combat. In the days when men were men and women were women, real leaders like King Harold II personally lead their troops into battle and were at no less risk than anyone else on the field.