First, I should know what does the “transfer” exactly mean? Did he sign a new contract with company B and resign from company A? Or you just do some amendment to the original contract?
If he left company A for personal reason, his working years should not be calculated continuously; but if he transferred under the company’s arrangement, his working years should be calculated continuously.
If you just do some amendment to the original contract, his working years also should be calculated continuously.
It is very important to the compensation affairs.
Besides, you should comply with the relevant rules of Labor Contract Law (provision 39, 40, 41, 42, 43, 46, 47, 50) in this termination or revocation.