The detection of phase transitions in quantum many-body systems with lowest possible prior knowledge of their details is among the most rousing goals of the flourishing application of machine-learning techniques to physical questions. By training a Generative Adversarial Network (GAN) with a very general representative quantity of different one-dimensional quantum models, we are able to detect the elusive gapless-to-gapped Berezinskii-Kosterlitz-Thouless phase transition. Its identification is possible by looking at the machine inability to reconstruct outsider data with respect to the training set in an anomaly detection scheme.