Archive mails in Apple Mail plus Office 365 setup
Sorry for not explaining much in detail considering that the questions are self-explanatory and the links I added had the rest of the solutions.
As been already explained, the mails have heaped to a huge bulk, probably, thus filling up the inbox and slowing down your account. Archiving them all is definitely a good option. 
This article will explain you how to archive your mails for Apple mail:
https://support.apple.com/en-in/guide/mail/use-the-archive-mailbox-mail35918/mac
Avoiding machine storage leaves you to options like Dropbox and Google drive.
I recommend Google drive for its unlimited storage capacity. You need to install google drive on your system. 
This thread speaks how to save your emails to google drive:
https://productforums.google.com/forum/#!topic/gmail/gCc99XgqMzw;context-place=forum/gmail/categories
This manual process carries the chances of losing out some of your mail contents. You can use Mail Backup X for the job. It sets the right sync between your mails and the storage location.