Altered brain dynamics across bipolar disorder and schizophrenia revealed by overlapping brain states