The Joint Effect of Task Similarity and Overparameterization on Catastrophic Forgetting -- An Analytical Model