How to Backup Apple Mail Gmail database to External Hard drive?
As you are thinking of backing up your Gmail account, there are multiple applications available online (paid) to backup Gmail Account as well as Apple Mail. One I found interesting was: http://www.mailbackupx.com/how-to-scenerios/how-to-backup-apple-mac-mail-mails-on-mac.html

However, you can always set your Time Machine to backup only your mail folders as Apple Mail makes an automatic backup of all the incoming and offline emails as well. You will have to exclude all the other folders and set the Time Machine to Backup this folder only: /Users/username/Library/Mail and /Users/username/Library/Mail Downloads

Also, you can direct the storage location to an external storage in Time Machine only and your backup will happen automatically.