Apple's desktop Mail client may not let you back up your entire setup, but it does allow you to export mailboxes, which can be opened in Google's Gmail and Mozilla's Thunderbird. Just make sure to put all your messages into the same mailbox beforehand.
Here's how to export a mailbox in Apple's Mail client.
1. Select a mailbox or folder.
2. Click Mailbox.
You've exported a mailbox from Apple Mail.