As long as you use a physical copy, the cartridge holds the data, not the 3DS itself. If you use a digital copy, however, the data would be saved to the micro SD card.
edit: basically, the 3DS is just used to show what's on the cartridge or card, rather than saving the data to the console itself.