Hey there!
Can you say if these mailboxes were on the On My Mac section (local) of your previous Mac (Or backup)?
If so, I’ve found Matti Haveri’s solution to work before, although many times, I’ve had to manually pull those specific mailboxes over from the backup, (They’re hidden by default), then import them into the Mail app again for whatever reason, sometimes those don’t transfer, let me know if that’s the case.
Otherwise, and this may not be the case, I know the Mail interface has changed a bit, and if they are syncing mailboxes, (with the email provider), they may just be hiding and need to be told to “Show”. That info may help.
Likewise, if the account was a POP account and not IMAP, it’s possible they may not be there at all, if they’ve already deleted from the provider’s server. If syncing, do these same mailboxes show up on your other devices?
Can you say where the previous location of the missing mailboxes were?:
Under
On This Mac.
Gmail.
Yahoo.
iCloud, (Examples).
If they were IMAP, or POP, and if they do show up on your other devices?
You can find most email provider settings with Apple’s tool, Mail Settings Lookup:
https://support.apple.com/mail
I find that helpful at times, let me know what you can find out, happy to help out if I can!