It is recommended to work for few months, to get H1B related status and paystubs…But, you can transfer earlier too, but as always better safe than sorry.
Source: Redbus h1b 1