https://retropie.org.uk/docs/EmulationStation/#gamelistxml-edits

If you use the built-in ES Scraper, your gamelist and image folders will be in ~/.emulationstation; I don't think you can change this.

If however you use another scraper (Steven Sselph's scraper or Lars Muldjord's Skyscraper) you can choose whether your scraped data goes there, or in the roms folder; if the folder is mapped to an external SSD then the scraped data will be there too, or else it will migrate along with the roms themselves by whatever other method you use (i.e. just backing up the roms folder over network shares, etc.)