how do I register a truck I bring in from Mexico?
You would have to read the instructions for how to register an imported vehicle.  I can link you to those instructions.
why did I get a ticket for no NY registration if the cop had no way of knowing if I lived in NY or just passing by?  I did rent in nyc by the way but had only been there 4 months
A police officer can use that 4 months evidence as the reason to issue a traffic ticket if you drive in NY State without a driver license or vehicle registration issued by NY State.