Data-driven emergence of convolutional structure in neural networks