Archive command basically moves the messages in a folder named Archive inside the specific account. Any e-mail account can have its archive: https://support.apple.com/guide/mail/archive-emails-mail35918/mac
The e-mails are still inside Mail app and the Archive folder is IMAP synced.
Actually, creating manually a folder and moving to it some messages has the same effect.
It's not exactly what you're looking for, because the messages will still appear in Mail.
Personally I archive old e-mail in a local folder (listed under On My Mac in Mail): still inside Mail (useful in my opinion for searching purposes) yet not taking space on my e-mail server because available only locally.