Reservoir engineering and dynamical phase transitions in optomechanical arrays