Can I transfer all Mail accounts to a new Mac? I have many email accounts in my Mail app, lets say 15. Entering the necessary values and passwords etc. for each of these is a huge pain. Is it possible to somehow "save" all of those accounts and transfer them to a new Mac, so I don't need to do it manually? This would include icloud mail, gmail, exchange, etc. accounts and passwords.

Note that in this case I am using macOS Sierra. Also note that I am referring to transferring the accounts login information and email server info to receive and send emails, and not referring to transferring actual emails.
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.