Phase transitions for the multifractal analysis of self-similar measures