In-Context Learning can Perform Continual Learning Like Humans