You can replace any attack roll, saving throw, or ability check made by you or a creature that you can see with one of these foretelling rolls. You must choose to do so before the roll, and you can replace a roll in this way only once per turn.
In the introduction to the PHB (p. 7) and basic rules, the 3rd paragraph under "The D20" describes saving throws, attack rolls, and ability checks as (emphasis mine):
[...] the three main kinds of d20 rolls, forming the core of the rules of the game.
All three of them consist of a d20 roll and then modifiers are applied to this die roll.
The description of Portent is quite foggy. The first sentence suggests that it allows to replace the final result (d20 + modifiers); however, the second part of the description mentions the roll, without specifying if it just refers to the d20 roll or to d20 + modifiers.
Does the Portent feature allow the Divination wizard to replace just the d20 roll? Or does it replace the final result?
This topic is covered in several answers and questions related to Portent working with other rules/aspects of the game, but I believe that this aspect of Portent needs a dedicated question. Some of these answers cite tweets by rules designer Jeremy Crawford. On one hand, the Sage Advice Compendium ("Official Ruling" section) states that tweets are not considered official anymore; on the other hand, in the very same section it also states that Crawford's tweets could be a preview of rulings that will appear in the SAC. Crawford's tweets about this issue here and here have not been still included in any version of the Sage Advice Compendium, to the best of my knowledge.