Is that as easy to confirm? that is knowing if the person you are transacting with on P2P is a criminal? Till now I never really thought about OP's concern which is really valid and since most of us have these p2p transactions how do I really know which of the "Satoshi" was criminally obtained since I was buying them in bits on different transactions?
Have you seen any special tags on wallets owned by hackers or criminals in crypto before? That might help you identify it.
But in the case of P2P platforms then I think the service will verify the seller's account and wallet first before allowing him to make transactions through the platform. So I'm probably pretty sure that platforms like Binance P2P have actually done thorough due diligence for every seller who wants to trade P2P there so that buyers no longer worry about the history of the funds they got. But of course if they still have doubts, then use a mixer to erase the history before hold them in the wallet.