Generalizing Tree Probability Estimation via Bayesian Networks