The phase-separation mechanism of a binary mixture in a three-well potential