Dynamics of gene expression and chromatin marking during cell state transition