Predicting electronic structures at any length scale with machine learning