Phase transitions for the long-time behaviour of interacting diffusions