Diagonalization of the finite Hilbert transform on two adjacent intervals: the Riemann–Hilbert approach