Generalized Lüscher’s formula in multichannel baryon-baryon scattering