The eligibility to extend/transfer H1 beyond 6 years is based on the validity of the approved I-140, whether your current H1 petition has 3 years left, or will expire soon, or you are not in H1 status anymore doesn't matter. (If you are not in any non-immigrant status, the COS/EOS part can not be approved and you need to reenter with H1 visa after the H1 petition approval)