A Generalizable Physics-informed Learning Framework for Risk Probability Estimation