You can email your boss the resignation letter, once your H1b transfer was filed. A small gap does not matter, if he let you go immediatly. If you tell your boss the resignation at the beginning of the month, then that will be even safer, since it is far away from the last pay date. Do not forget to use PP, even it may be paid by yourself.