Walgreens Boots Alliance has entered into a definitive agreement to be acquired by an entity affiliated with private equity firm Sycamore Partners for up to $23.7 billion.