LOS ANGELES - Shia LaBeouf learned how to play with others on action-movie sets, which may help explain why he’s often ready for a fight. One scrape last October during the filming of “Transformers: Dark of the Moon” at Florida’s Kennedy Space Center pitted the young actor against director Michael Bay over a song.

With military and NASA personnel watching, Bay and his leading man were shooting an emotional sequence from the script’s third act on a shuttle launchpad at Cape Canaveral. To put himself in a somber frame of mind, LaBeouf plugged his iPod into some speakers and started playing a wistful ballad, Feist’s “Brandy Alexander.”

“Yeah, it’s a little feminine, but it touches me,” LaBeouf says, starting to pepper his recollection with more expletives than are allowed in the PG-13 film. “I feel something when I hear it. ... But Mike doesn’t want to listen to ‘Brandy Alexander’ under the rocket with 50 military dudes around.”

Bay unplugged the actor’s iPod, LaBeouf says, and replaced it with his own, cueing up the propulsive, orchestral “The Dark Knight” score. “I take him aside, I’m like, ‘Mike, this is the most important moment in the movie for me. The crux of my whole character, my whole arc. That doesn’t work for me, dude.’ ... Now it’s two dudes ready to kill each other. ... Spit’s flying.” According to LaBeouf, Bay left the set with the NASA/military entourage, and his director of photography finished shooting the sequence without him. (Bay declined to be interviewed for this piece.)

After working on three “Transformers” movies together, the 25-year-old actor says, Bay is “sort of my big brother. ...We’re both very game, very passionate people. Sometimes it’s not actor-director. Sometimes it’s two dudes yelling over explosions. Sometimes it doesn’t sound like the friendliest conversation. But we love each other.”

LaBeouf is relating the story from a divey Middle Eastern restaurant in a Hollywood strip mall, a Lionel Richie song playing in the background as a waiter delivers his usual order^=“my chicken thing with those crispy deals” and some steaming Turkish coffee. “I come here for the decor,” LaBeouf says, gesturing at the mostly empty eatery’s eight Formica tables. “There’s candleholders. It’s opulence.”

Lean, shaggy-haired and smart alecky sometimes to the point of self-destruction, LaBeouf has little in common with the beefy, well-behaved heroes of many summer popcorn movies. On a good day, his off-screen candor merely gives some studio executives heartburn; on a bad day, it lands him in a bar fight. But he insists that he’s finally starting to grow up.

LaBeouf, raised in L.A.’s Echo Park neighborhood, the only child of a Vietnam veteran and ballerina, is the first artist in his family to make it. He has been steadily employed since age 13, when he was cast as the wisecracking star of the Disney Channel tween sitcom “Even Stevens,” and today his multimillion-dollar paydays support both parents in separate homes. (LaBeouf says his father, a onetime heroin addict, is now clean^=“My parents are retired basically. He’s painting again. She likes nature.”)

LaBeouf was handpicked by executive producer Steven Spielberg to be the human face of the “Transformers” franchise, which so far has grossed more than $1.5 billion worldwide; the third installment reaches theaters on 3-D screens Tuesday night, and opens wide on Wednesday. He was also the young heart of Spielberg’s 2008 Indiana Jones reboot, “The Kingdom of the Crystal Skull,” fulfilling the kind of relatable adventurer role Richard Dreyfuss did in 1970s Spielberg movies such as “Jaws” and “Close Encounters of the Third Kind.”

“That’s a gift and a curse,” LaBeouf says, of being Spielberg’s 21st century hero. “Steven introduced me to the world in a way. The man has been incredible to me. But the work that I’ve done with him, the character variation is not heavy. It’s sort of all in the same vein. ... I’ve gotta anchor these movies that are in these outrageous worlds, and I have to be as tangible as possible. ... I have no problem with that, but I don’t want to be there forever.”

Inspired by a line of Hasbro toys from the 1980s, the “Transformers” movies depict warring bands of giant, sentient robots from the planet Cybertron that can shape-shift into cars and other vehicles. LaBeouf plays Sam Witwicky, a reluctant soldier in the war between the benevolent Autobots and the evil Decepticons.

In the latest film, Sam has graduated from college and has a new love interest, Carly (Rosie Huntington-Whiteley). The Autobots, meanwhile, have learned of a Cybertronian spacecraft on the moon, and they’re racing against the Decepticons to find it.

Critics love to hate the “Transformers” films, but that hasn’t kept audiences away. The second movie, “Revenge of the Fallen,” was rushed into production with a ragged script due to the 2007-08 Writers Guild of America strike and earned an abysmal 20 percent “fresh” rating on the Rotten Tomatoes website, yet still became the second-highest-grossing film in the U.S. in 2009.

“This movie’s very different, more physicality, darker premise, more story line, clearer thought,” LaBeouf says of “Dark of the Moon.” ‘’I feel very confident in it. The last hour ... is the greatest action sequence of Mike’s career, which would put it on the same level as the greatest action ever made. ...The second movie we were making on the fly, and it was too convoluted.”

Like the character he plays, LaBeouf has developed since being handed his first blockbuster. “He’s grown as a person, as an actor,” says “Transformers” producer Ian Bryce. “He’s a man now.”