Phase transition in the sample complexity of likelihood-based phylogeny inference