The German grocer has entered into an agreement to buy about 400 store locations from Winn-Dixie and Harveys Supermarket.