Whenever any officer or employee ofsuch city is transferred from one department to another, he shall be entitled to become a member of the pension fund of the department to which he has been transferred and to receive credit for the years ofservice in the department from which he has been transferred by paying the pension fund of the department to which he is transferred the amount ofpremiums he would have paid into said fund ifhe had been a member ofsaid department for the number of years he claims credit for service in the other department. Such transferred employee shall have the right to have transferred from the pension fund the amount he had paid into such fund. The rights given in this act shall be effective as to the officers and employees who have transferred prior to this act, as well as future transferees. This act shall apply to all the pension funds of such city, namely the police officer's pension fund, and firemen's [fighter's] pension fund and the general employees' pension fund.