Mechanisms of phase transitions in sodium clusters: From molecular to bulk behavior