Any two or more boards of education may, in writing, agree to establish shared service agreements between such boards of education or between such boards of education and the municipalities in which such boards of education are located.