Your cell phone knows when you're roaming because:
The Mobile Telephone Switching Office (MTSO) checks your SID code in its database.
The global positioning system (GPS) chip in your phone informs the cell towers of your location.
The cell towers triangulate your position, and your phone's processor compares it to your service area.
None of the above.