Stem cell differentiation is a stochastic process with memory