Ultrafast dynamics of electrons and phonons: from the two-temperature model to the time-dependent Boltzmann equation