A general spectral slope-exposure relation for S-type main belt and near-earth asteroids