A Phase Transition for Circle Maps and Cherry Flows