Semantic Codebook Learning for Dynamic Recommendation Models