The evolution of wealth transmission in human populations: a stochastic model