Preliminary elections in 30 cities and towns this month and October, followed by Nov. 7 elections in nearly 60 municipalities, could reshape local politics in Massachusetts, particularly in crowded mayoral contests. Nearly three dozen mayors are up for reelection this fall, according to a list from the Massachusetts Municipal Association. But of those, at least five are not looking to serve another term in office.