You have a 2.3l DOHC Duratec engine in the 2008 Ranger
Its a Mazda L engine rebranded by Ford, read here:
https://en.wikipedia.org/wiki/Mazda_L_engine
Its a 23NS
Not sure what New York laws are but in many states you can only change engines from year of vehicle or newer and must have proof of year
So 2008 to 2012 in your case
But thats if a shop does the work, if you do the work then who will know, lol
Or if you swapped in a different size engine, you would for sure need to check the laws
2004 to 2012 Ranger 2.3l will work
2004 to 2009 Mazda B2300 will also work, Mazda B-series ended in 2009 in North Anerica
The 2001 to 2003 2.3l Duratec had IMRC(intake manifold runner control) which added no power or fuel economy, and often broke, lol, so not good years to look at
When engine or trans is out you will want to install new rear hoses and fittings for cooling system, these could leak over time and are almost impossible to get at without dropping the transmission.
Engine was designed to mount sideways so these hoses and fittings wouldn't be a big issue to work on, in a Ranger they are
Also new rear main seal, always, when you have access to it