Characterizing Online and Private Learnability under Distributional Constraints via Generalized Smoothness