Meryl Streep has mastered Margaret Thatcher’s brawny gait, put on 15 pounds playing Julia Child and conquered countless accents for movie roles: British, Irish, German, Polish and Brooklyn, to name just a few. But for her new film, Streep had to learn to act like a rock ’n’ roll badass. In “Ricki and the Flash,” opening Friday, she plays Ricki Randazzo, the lead singer of a blues-rock bar band and a mom wrapped up in family turmoil. What did it take to transform the Oscar winner into a hard-rocking, hard-living chick? The film’s creative team told The Post.

The guitar skills

Streep with her daughter Mamie Gunner, who also plays her daughter, Julie, in the film.Sony Pictures

“The reason [Streep] is believable is that it’s actually her playing,” says Neil Citron, who coached the actress on guitar. There’s no stunt double jamming behind a curtain. Before meeting Citron, who has played with heavy-metal gods Quiet Riot, the hard-working Streep had only dabbled on guitar. “She knew some basic chords . . . D and A and a little bit of a G chord,” he tells The Post.

Citron coached her for a month, eight hours every day, before two weeks of rehearsals with the guys who play the members of her band — real-life working musicians including Rick Springfield and Parliament-Funkadelic keyboardist Bernie Worrell.

Streep mastered the songs “My Love Will Not Let You Down” by Bruce Springsteen and Lady Gaga’s “Bad Romance,” both used in the movie, as well as “Cold One,” written for the film by LA country rockers Jenny Lewis and Johnathan Rice.

The practice paid off. Springfield told The Post back in February that Streep “looks more comfortable with a guitar on her than I do! It’s pretty amazing. I saw how brave she was — and she didn’t need to be, because she’s who she is, but she was experimenting.”

Sony Pictures

The vocal chops

While Streep has sung on-screen before — in “Mamma Mia!” and “Into the Woods” — Ricki is a blues rocker. Citron compares the character’s gritty, soulful style to Bonnie Raitt or Chrisie Hynde.

On the first day the band played together, Citron recalls, “[Streep] was so excited. You could see it in her face.” But she wasn’t quite prepared for rock ’n’ roll volume, telling Citron: “You said it was going to be loud, but it was really loud.”

The tattoos

In addition to the initials of Ricki’s kids, Streep wanted ink that looked like it had “been done in a bad tattoo parlor” 30 years earlier. She came up with the idea for an American flag with a “Don’t Tread on Me”-style snake — related to the death of the character’s brother in the Vietnam War.

The look

“When Meryl first walked in, she had a vision [for Ricki],” says makeup designer Bernadette Mazur. “She had her hair braided, she had dark [shadow] around her eyes.” Mazur recalls Streep saying, “This is what I’ve been living with. This is what I would like [Ricki] to look like.”