Cosmological phase transitions and radius stabilization in higher dimensions