How neural networks learn to classify chaotic time series