It depends on the sensor.
The older sensors do not have a command in 4.1 to show the serial number. You would have to look for the sticker or upgrade to 5.0.
The newer model sensors (the IPS-4240 and IPS-4255) do have a "show inventory" command that will show you the serial number in 4.1 (and in 5.0).
The IDSM-2 serial I believe can seen with the "show module" command on the switch CLI.
I am not sure about the NM-CIDS, but I believe there is a router command to see the NM-CIDS serial number.
Once you install version 5.0, then you CAN see the serial number on ALL sensors models (new and old) using the "show version" command.