We show that a simple artificial neural network trained on entanglement spectra of individual states of a many-body quantum system can be used to determine the transition between a many-body localized and a thermalizing regime. Specifically, we study the Heisenberg spin-1/2 chain in a random external field. We employ a multilayer perceptron with a single hidden layer, which is trained on labelled entanglement spectra pertaining to the fully localized and fully thermal regimes. We then apply this network to classify spectra belonging to states in the transition region. For training, we use a cost function that contains, in addition to the usual error and regularization parts, a term that favors a confident classification of the transition region states. The resulting phase diagram is in good agreement with the one obtained by more conventional methods and can be computed for small systems. We furthermore map out the structure of eigenstates across the transition with spatial resolution and use this to numerically confirm predictions made by renormalization group studies. We test the robustness of these results against providing the input data in alternate forms, such as the level spacings of the entanglement spectra, and analyze the network operation using the dreaming technique.