There is a (free within the airport) Airtrain outside of security for changing terminals https:/…jfk-airtrain-brochure-english.pdf
Whether or not you need to check in again and transfer your luggage will depend on what kind of ticket(s) you have.
JFK does NOT have airside transfers except for a limited number between the 2 Delta terminals (not yours) so you will have to take the Airtrain to the next terminal and go through security again. If your luggage will be checked through or if you have to pick it up and recheck it only your airline can tell you (we don;t know what tickets you have bought).
You should verify with Delta if they will forward your luggage from your domestic to international flight and if you'll get all your boarding passes at your initial check in Detroit. (Hopefully, but safer to check with them.)
You must leave security to go to between T4 and T1.