Outlook should do this automatically. If you setup the AutoArchive settings to autoarchive automatically when it archives email from a folder it doesn’t have in the archive file it will create it then archive the email.
When you set up auto archive, you also have to go into each subfolder and check “archive this folder”. Right-click the folder, go to properties, then go to the “AutoArchice” tab to change the setting. The subfolders have to be done individually one by one, they are not set up automatically.