Harnessing flexibility of the transmission grid to enhance reliability of the power system