An easy way is to use an IMAP client like the macOS Mail.app that syncs raw email + metadata in .mbox format. You can find the files in ~/Library/Mail/V4. Combine with Time Machine for extra backups in case you’re worried that your mail server decides to clear your local copy over IMAP.
Not sure if it's the best way or not, but I use offlineimap...