Simple lessons from complex learning: what a neural network model learns about cosmic structure formation