The phase transition to eternal inflation