If I remember my minimal insider trading training it’s legal if you aren’t an insider. So the example I remember is if you overhear insiders talking in an elevator and trade, that’s legal. If they tell you, that’s illegal.
There are people who mirror the disclosures of trades from Pelosi and others. But by then it’s not possible to realize all the gains.