Persistent Entropy as a Detector of Phase Transitions