If you are part of the conversation, it is legal to take a screenshot and share it. However, it would be unlawful to screenshot someone else's WhatsApp messages and share them without their permission.