A H1B visa is a dual intent visa, meaning you can petition for permanent residency without putting your H1B in jeopardy. If you do not quit your job, you will remain in H1B status while your petition remains pending. As long as you remain in H1B status, you can transfer your H1B after the filing of the I-130/I-1485.
Once you switch from H1B status to pending AOS based upon the marriage and petition to adjust your status, you should not engage in international travel. (If that's going to be an issue, ask a follow-up question and we can discuss possible options.)
Logistically speaking, you'll save yourself some paperwork if you file the I-130 after the H1B transfer, but if timing is an issue I don't see it as a big deal.

