From energy legislation to investment determination: Shaping future electricity markets with different flexibility options