Review this: https://codex.wordpress.org/Installing_WordPress#Famous_5-Minute_Install
Here are the major tasks that you need to complete:
1. Create a new database (for the new WordPress web site) on Hostgator. This will be accomplished using the phpMyAdmin tool available through Hostgator's cPanel. Refer to WordPress.org URL above or the specific instructions pertinent to a WordPress database.
2. Export your localhost web site database tables (under XAMPP) for subsequent import into the database created in step 1, above. This is accomplished by starting XAMPP and using its phpMyAdmin interface to export your local WordPress database to a file that can be uploaded, and then imported by phpMyAdmin on Hostgator.
3. Transfer your WordPress web site files from your localhost (i.e., XAMPP) installation up to your Hostgator /public_HTML/[my new web site]/ folder. Again, refer to WordPress.org URL above for specific details. This is best accomplished using Filezilla FTP software, but may be accomplished using Hostgator's File Manager interface via cPanel.
4. The Worpress.org installation instructions (the URL above) provide the detail about how to edit the wp-config.php file. This has to be edited in order for the uploaded web site files to point to the imported database on Hostgator.
5. Lastly, point your domain name to the new WordPress installation on Hostgator, and run the install script.
This is the basic process. Essentially, you'll be transferring both the database and the WordPress files, but as separate manual actions. Then, you'll be connecting the files to the database. Then, running the install script.
Hope this helps,
***Edit to add:
When you are satisfied with the installation on Hostgator, go to your domain registrar and re-direct the domain name to the new Hostgator installation. This effectively points the Internet to the new Hostgator web site, and NOT the old existing site.