To migrate data from/to your site, the migration tool needs to connect to it via the URL. Therefore, it will not work if you use a localhost URL.
To solve this problem, you can setup a temporary public URL for localhost using Ngrok. After installing Ngrok and starting a tunnel, you will get a public URL for your localhost site. You can enter the URL in the migration tool and start the migration.