A novel approach for constraining heat flow histories in sedimentary basins