Reconstruction of Fields from Sparse Sensing: Differentiable Sensor Placement Enhances Generalization