Can I transfer all Mail accounts to a new Mac?
You can transfer all accounts and passwords that are saved by transferring your Keychain from your old mac to your new mac.

Manually (long)

On your old mac

Go into your users Library folder which is /Library. By default, this folder is hidden. Open your finder and press, COMMAND+SHIFT+L. This should jump you to that location.

Finder the folder named, Keychain, and copy it to a USB drive or into iCloud.

If you use a USB drive, remove it from the mac now and go to your new mac.

On your new mac

Insert USB drive if thats what your using. Otherwise, go into your iCloud. Select the Keychain directory you saved there and copy it.

Go to your users Library by using the same method as before and paste the Keychain directory. If asked, merge the folders and authenticate. You may also replace the Keychain directory on the new mac with your old Keychain documents. This will replace any information such as logins you may have already saved on your new mac.

Easiest Method

Enable iCloud Keychain on your Apple ID.

Use the same Apple ID on both macs.

All login info will sync together like magic.