Everywhere in the US, the law around Terry stops[1] applies. In fact every time the police “pull you over” on the road is a Terry stop.
In such a stop, mere “reasonable suspicion” is required for police to require you to identify yourself. You’re not required to present ID but you must tell them your name (you could lie, but that’s another crime). You can be arrested for refusing to identify yourself.
In order to determine if your are experiencing a Terry stop, ask the officer “Am I free to go?”, if the answer is no, ask “Why am I being detained?” and the officer should state his cause. If it’s not valid you won’t be able to fight it until after the encounter, possibly after you’ve already been arrested.
Egregious example: The infamous NYC “stop and frisk” policy[2] was essentially a massive Terry-stop program.
[1] https://en.wikipedia.org/wiki/Terry_stop
[2] https://en.wikipedia.org/wiki/Stop-and-frisk_in_New_York_Cit...