Should be quite easy - NPC spawn rate is a roll of one_in(number). The number is currently hardcoded to be 100 + 15 * number of NPCs in current overmap tile. Both that 100 and that 15 could be easily made into settings.
This roll is invoked on two separate occasions: once when shifting the map (every 12 tiles of fully horizontal/vertical movement, less if going diagonal) and once every 10 minutes (40 if you have the inconspicuous trait).