H1B cannot be transferred. Your new employer has to file a new petition on your behalf and since you have a previously approved petition, they can process it cap-exempt citing the approval/petition number.
As for COS, I am not sure if COS from H4 to H1B is certain. Sometimes USCIS will ask you to go back to your home country for VISA stamping.
thanks for the response. my main query is with respect to whether my current company can revoke/cancel the petition once i resign. And in such a case, when a new petition is filed by other employer would it still be cap-exempt.
Yes, your company can cancel the petition.
Yes, the new petition filed by another employer will be cap-exempt as long as its within 6 years from the first approval.