Marginal Flow: a flexible and efficient framework for density estimation