I think the key is that we can relate to Sam; all he wants is a car and a girlfriend; and the fact that he becomes a nervous mess when he first meets Mikela makes him more endearing to us. He is then suitably astonished and full of wonder when he meets the Autobots. Shia really sells the character and makes the situation relatable to. The film is also genuinely funny, ok so the scene when the Autobots are hiding around the house as Sam looks for the glasses is fairly cringeworthy, but there are plenty of other good moments. John Turturro and Anthony Anderson are great at breaking up the action with light hearted relief. The voice actors are also important, Hugo Weaving giving life to a Megatron who isn't actually present for much of the film, and of course Peter Cullen is perfect as Optimus Prime.
Far from Michael Bay's self confessed film style of "fucking the camera" which make the Bad Boys films and the next two movies of this franchise so unwatchable, Transformers actually has moments of style. The initial attack on the air force base by Blackout was trouser-shakingly good (the volume in the cinema was cranked up!), Ironhide somersaulting over a screaming woman while avoiding rockets is very nicely done, as is Starscream jumping all over the F-16s in flight.
On top of this, Steve Jablonsky's score creates a suitably epic atmosphere while at the same time managing to echo some of the awe and wonder that Sam experiences. It's possible that the score is better than the film, and it's one I listen to regularly.
As I say, this is a real guilty pleasure and it's not like there aren't things wrong with it. During this latest viewing I was painfully aware of Bay's insistence on getting military hardware or lingo into scenes as much as possible; no doubt he was off camera getting his rocks off every time there was a helicopter nearby! However, despite his penchant for blowing stuff up, there is a section in the middle that is strangely calm. But since Bay doesn't know how to direct calm, it drags quite a bit when the Autobots are hiding round the house, until John Turturro arrives.
For me though, these faults aren't enough to spoil what is a fun film. It manages to weave a story that is fairly concise, with a central character we can relate to, into a film about giant alien robots. Excellent special effects, great action sequences (where we can actually see what's going on) and a great rousing score.