Taking a screenshot on your computer is legal; sharing it may not be
It's your computer; you can take as many screenshots as you like. You can keep these and use them for your own purposes including legal purposes.
Where you get into legal trouble is if you share a communication where there was a reasonable expectation of privacy. If I send you a message in a private chat room then there is a reasonable expectation that the communication is private to the members of the chatroom. If one of the members breaches that privacy and I suffer damage as a result then I may be able to sue.