Apple has instructions on how to Archive Mail but that only creates a new mailbox and placed them into it. I assume you want to move the mail off of your hard drive. I would use the Export feature (right-click on each mailbox and select Export Mailbox…) to export them to another drive and then delete the mailboxes you have exported from your current drive. (this assumes you are using Apple mail)
You can do this by selecting the mails you want to save locally. Click the CMD key and click on the selected mails at the same time, a menu opens. Tap on the Move to option and choose the local mailbox folder created just before. Depending on the number of emails to archive this operation may take a short time.