but if the H-1B transfer is approved. can I take a vacation at that time and go outside USA and then apply a H-1B visa for reenterance?
-Yes.
Why should I leave now in the pending period of my H-1B transfer?
-Yes but you can not apply for the H1 visa until the transfer is approved and then, use the h1 approval notice to get the H1 visa to come back. So, you may had better not leave US until the transfer is approved.