Notwithstanding any other provision of this article, the board may enter into an agreement in accordance with Section 20590 with the governing body of a contracting agency, and the governing body of a city maintaining its own retirement system for termination of the contracting agency’s participation in this system with respect to local firefighters and inclusion of those local firefighters in that city retirement system if the firefighting function of the contracting agency and the local firefighters have been transferred to that city. The contract shall continue with respect to all employees of the contracting agency other than local firefighters.