Where's the serial number of a Mac located, in the storage or in the firmware?
Serial numbers are stored within the logic board firmware. 

As a result, if you're trying to access a Mac in Target Disk Mode you're not going to get it's serial number from the Startup Disk (well, not unless someone has previously recorded the serial number on a file stored somewhere on the disk).

If you need the serial number and you can't boot into the Mac, there may be other ways to obtain it (e.g. Apple sometimes engraves serial numbers on the device, by contacting Apple, etc).