I need to uniquely identify a mobile device using the "ping" packets that it transmits to cellular towers regularly, in an area of interest by installing a packet sniffer at that location? I only need to identify the device real time, and not store the data somewhere for later use. Is that possible, and what are the circumstances under which that would become unlawful to do?
Mobile devices work across many channels, often in completely different frequency bands depending on the provider. So, even if you did have a device that could listen to traffic and watch for the IMSI/TMSI (IMSI is rarely ever broadcast, you can watch for TMSI which is a quasi-unique ID) it would need to operate across all the hundreds of viable channels, or else you are going to have to spend hours just doing one sweep (assuming your device is limited to one channel), in which time many devices will have probably arrived/left. The practical (note this does not mean legal) way is to impersonate a base station and wait for the devices to come to you. That is what IMSI catchers do, basically a MITM attack to get all nearby devices to admit who they are, because they think that your device is a nearby cell tower.
Here is a similar question on SE: https://networkengineering.stackexchange.com/questions/18070/detecting-2g-3g-4g-devices and here is an article about the lengths one needs to go to in order to just intercept ONE devices' IMSI without impersonating a base station: http://www.rtl-sdr.com/rtl-sdr-cell-phone-imsi-tmsi-key-sniffer/
If you can ping the device then you should be able to get the mac address of the hardware interface you are pinging (for a network everything needs a MAC address for the network lay communication).
The legality of it is grey, very grey, though if genuine non malicious research that does not hinder or risk hindering anyone and you can not identify that person nor have any data saved on that person. then I don't see why it would be a problem, though I would consult someone with a bit more legal standing than my self. its really hard to say.
I hope I understood your question