We present a framework in which the transition between a many-body localised (MBL) phase and an ergodic one is symmetry breaking. We consider random Floquet spin chains, expressing their averaged spectral form factor (SFF) as a function of time in terms of a transfer matrix that acts in the space direction. The SFF is determined by the leading eigenvalues of this transfer matrix. In the MBL phase the leading eigenvalue is unique, as in a symmetry-unbroken phase, while in the ergodic phase and at late times the leading eigenvalues are asymptotically degenerate, as in a system with degenerate symmetry-breaking phases. We identify the broken symmetry of the transfer matrix, introduce a local order parameter for the transition, and show that the associated correlation functions are long-ranged only in the ergodic phase.