Before the curtain lifts on the final act of the Robert Mueller investigation – which is not necessarily to say the final act of the Donald Trump presidency – there has been a a scramble for seats as second-tier figures in the drama choose sides.

Some of the players have agreed to work with the special counsel as he investigates possible collusion between Russia and Donald Trump’s presidential campaign. Others are standing by Trump. Former campaign chairman Paul Manafort vowed never to work with Mueller, then agreed to work with Mueller, then allegedly tried to put one over Mueller.

Like the methodical prosecutor he is, Mueller has forced each target of his investigation, one by one, to pick a side, offering reduced penalties to cooperators such as Michael Flynn and hammering Manafort, whom Mueller accused Friday of lying to investigators about maintaining contacts inside the White House as recently as May.

Trump, for his part, has been trying to disrupt the process, praising former aides who “refused to break” and “still have guts” while slamming his former attack dog Michael Cohen, who has been cooperating with Mueller, as a “weak” liar and a bad lawyer to boot.

This is what you do when you’re investigating the Gambino family, or a motorcycle gang, or any other group of criminals Patrick Cotter

The secret of why, exactly, Trump appears to be growing so desperate in the face of his former aides’ mutiny – by midday Friday, the president had tweeted seven times about Mueller – promises to be revealed in the final act.

The drama, meanwhile, has heated up aggressively in the last week, with former Trump adviser Roger Stone invoking fifth amendment protections to maintain his silence, and Mueller unveiling the extent of Cohen’s co-operation, writing approvingly of Flynn’s conduct, and explaining to a judge how Manafort allegedly tried to outsmart him.

To a certain set of federal prosecutors, the visible struggle between Trump and Mueller for the loyalty of former Trump aides is familiar, because it is straight out of the playbook for prosecuting organized crime.

“The decision to cooperate with prosecutors always comes down to loyalty,” said Elie Honig, a former federal prosecutor from the southern district of New York who helped dismantle the Sicilian mafia.

“Who are you going to prioritize?” Honig said. “Are you going to cooperate and minimize your own exposure, and likely minimize the pain, and emotional and financial hardship on your family – or are you going to stay loyal to the people who you committed crimes with?”

Michael Cohen leaves court in New York in August. Photograph: Mary Altaffer/AP

Controversially, owing to its potentially disastrous erosion of the rule of law coming from the mouth of a president, Trump has objected to Mueller’s tactic of “flipping” witnesses – Flynn, Rick Gates, George Papadopoulos, Cohen, Manafort (temporarily) and counting – arguing that it amounts to an enticement to lie.

“You know they make up stories, people make up stories,” Trump told Fox News in August. “This whole thing about flipping, they call it, I know all about flipping. For 30 to 40 years I’ve been watching flippers … It almost ought to be outlawed. It’s not fair.”

But Patrick Cotter, a former federal prosecutor who was part of the team that convicted the Gambino family boss John Gotti, said not only is “flipping” a witness fair, it is “exceedingly common” in group investigations.

“This is what you do when you’re investigating the Gambino crime family, or a motorcycle gang, or any other group of criminals that are engaged in a conspiracy,” said Cotter. “You’ve got to get inside. And usually you need somebody on the inside to tell you what’s going on, and that opens up some doors.”

Mob bosses hold sway over their soldiers because they hold the purse strings for their soldiers … when they go to jail Daniel Goldman

All the former prosecutors the Guardian spoke with cautioned that they did not mean by their analysis to say that Trump is a mob boss, or that the Mueller investigation is strictly an organized crime investigation. But the similarities kept coming up.

Daniel Goldman was deputy chief of the organized crime unit in the southern district of New York, where he was an assistant US attorney for a decade.

“To play the mafia analogy out a little further,” Goldman said, “mob bosses hold sway over their soldiers because they hold the purse strings for their soldiers and their soldiers’ families, particularly when they go to jail, and they sort of rule with an implicit iron fist that reacts to cooperation with violence up to, potentially, death.

“Trump holds sway over his associates through his presidential pardon power and he’s not afraid to explicitly reference that power in connection to individuals who may have information about his own criminal activity. And so the parallels are very strong.”

Of the various ways he has broken precedent as president, Trump’s visibly dangling pardons in an apparent effort to shore up the loyalty of former aides has caused deep consternation among those with professional experience enforcing the law.

On the same day that Trump said Cohen should serve a “full sentence”, he tweeted that Stone was the victim of a “rogue and out of control prosecutor” and praised Stone’s “guts”. Days earlier he had said a pardon for Manafort was not “off the table”.

Manafort just apparently thought he was clever, and he was smarter than everybody else, and it blew up in his face Patrick Cotter

“It’s an amazing thing for a president of the United States to say,” said Cotter. “The possibility of a pardon is explicitly mentioned by the one person on the whole planet who can give him a pardon. It’s stunning. It’s stunning. And I think it’s obstruction of justice.”

Goldman echoed Cotter’s outrage.

“I think even putting aside whether or not it’s criminal, it is incredibly disheartening for anyone who believes in the rule of law, who believes in our criminal justice system, that you would have the chief law enforcement officer in the land who is unable to think about this investigation in anything other than personal ways,” Goldman said.

One cipher in the visible struggle over loyalty has been Manafort, who has switched “sides” twice and appears to have attempted an end-run around the special counsel.

Not smart, said Cotter.

“The beginning of every single meeting is the government lawyer telling them across the table, to their face, ‘You must not lie to me,’” he said. “‘If you lie to me it’s going to be far worse than if you simply stood up now and walked out that door. If you’re not going to tell me the whole truth the whole way, please get up and walk out that door.’

“Manafort just apparently thought he was clever, and he was smarter than everybody else, and it blew up in his face, and frankly it always does.”

Paul Manafort leaves court in Washington in February. Photograph: Yuri Gripas/Reuters

As for when the final act in the Mueller investigation will begin, the swarm of court filings and jockeying of the past two weeks could indicate that “there’s still quite a bit to go”, said Honig.

“I think these past couple weeks have shown us that we’re not really in the ninth inning as some people had said,” he said, “that Mueller’s still got a lot of information that he’s processing and dealing with that’s turning into potentially criminal charges – and I think that the bigger picture is sort of starting to come into focus.”

Cotter said: “We’re in stage two. We’re hearing the indictments and the pleas, people cooperating. Then there’s going to be a stage three, where people who are not cooperating, just – the hammer falls.

“And I don’t know if it’s going to be Don Jr, or [Jared] Kushner, or who knows. But I think it’s going to happen, and I can’t tell you when. But I think it’s going to happen.”