Dynamics of entanglement entropy and entanglement spectrum crossing a quantum phase transition