Neither. Pirates 3 was way better than Spider man 3, and I haven't seen Transformers so I can't pick it.
I have'nt watched Transformers but spiderman 3 is a movie that you must watch. I bet both are equally good.
Between those two , Transformers.
I'll have to say Transformers. Here's a comparison: The Storyline: SPIDER-MAN 3 Peter starts to enjoy being a hero, to the point of risking the people he loves (including his fiancee MJ) just to satisfy his ego and wants. In the end, he almost lost MJ (again, as with the first 2 films) and reunited with his best friend (who died anyway). TRANSFORMERS A group of robots called Decepticons are looking for the AllSpark, a device from their planet Cybertron that can turn objects into robots as well. Luckily, Autobots led by Optimus Prime are here on Earth to save the day. Winner: SPIDER-MAN 3 Action Scenes to watch out for: SPIDER-MAN 3 Sandman's attack on the city, and the final battle between Spidey and Venom (with the steel bars) TRANSFORMERS The first Decepticon attack on a military base, the scorpion-like Decepticon attacking a Middle East country, and the chase scene between the yellow Camaro and the police car. Winner: TRANSFORMERS The actors: SPIDER-MAN 3 Tobey Maguire looks silly as a hero gone bad. Thomas Haden Church was under-utilized. And Kirsten Dunst's performance was lazy. TRANSFORMERS Shia LaBeouf! Megan Fox the bombshell! Shia LaBeouf! This lead actor carried this movie throughout the end, with his charm and humor. Winner: TRANSFORMERS
I have to go for Transformers. Being totally unbiased - never been a fan of Spidey or Transformers, I was awestruck by Transformers. Spiderman 3 was good too - but failed as a total packaged. It was too long and I was aware that it was too long and that's the reason it lost me (unlike Pirates 3 -which was long too but it kept me interested - but Pirates 3 is not part of this question) Yeah! Go Transformers!