The mayor, before exercising the duties of office, shall take and subscribe an oath or affirmation of office under 53 Pa.C.S. § 1141 (relating to form of oaths of office). The oath or affirmation may be taken before a judge or magisterial district judge of the county or a notary public and shall be filed with the borough secretary and be preserved among the records of the borough for a period of six years.