Understanding and Improving Continuous Adversarial Training for LLMs via In-context Learning Theory