Generalizable Physics-Informed Learning for Stochastic Safety-Critical Systems