We present a numerical model for the evolution of pathogens organised in discrete antigenic clusters, where individuals in the same clusters have the same fitness. The fitness of each cluster is a decreasing function of the total number of cluster members appeared in the population. Cluster transition is modelled with inclusion and exclusion of dynamical epistatic effects. In both cases we observe a continuous transition, driven by the mutation rate, from a dynamics with single clusters alternating in time to the coexistence of many clusters in the population. The transition between the two regimes is investigated in terms of the key parameters of the model. We find that the location and the scaling of this transition can be explained in terms of the time of first appearance of a new cluster in the population. The presence of dynamical epistatic effects results in a shift of the value of the mutation rate where the transition occurs.