A self-consistent two-body method for three-body systems and the hypernucleus ΛBe9