Continuous unitary transformations in two-level boson systems