It does not specifically state, but the feat becomes much less interesting/powerful if you don't know the raw result.
The text for lucky states, emphasis mine (PHB, 167):
You can also spend one luck point when an attack roll is made against you. Roll a d20, and then choose whether the attack uses the attacker’s roll or yours.
If you don't have knowledge of the initial d20, that heavily implies that you must know what the raw roll was in order to compare it against yours. If you didn't have the opportunity to know, then it would work more like the Portent Ability of a Divination Wizard but that you roll your D20 at the time of the event. In order to decide which die result to use, you have to know what the numbers are.
See this related answer for some more discussion already covered on this.
No modifiers known, no outcome known
Knowing the raw result of the dice is not the same thing as knowing the outcome and the rules for Lucky specifically state that you don't know the outcome. The player still must choose between the number rolled on the DMs die vs the number rolled on your lucky die.
Open rolls vs Behind the screen
This is where it gets tricky, as not every DM rolls openly. If you (or your DM) chooses not to disclose any rolls, that significantly impacts the value of the lucky feat - and this should be discussed before someone chooses the feat. The rules are not explicit, but implicit in the ability for the player to know the number on the die.
And yes, it is still a choice when picking a known quantity (your roll) vs what is behind door number 3 (DMs roll), but that is significantly less impactful, interesting, and fun. It also means the player must be Lucky in their own roll as well as lucky in guessing what the DM rolled. If a DM chooses to keep those rolls hidden, I personally would not recommend picking this feat.
Crawford implies knowing natural result
In this twitter conversation, Jeremy Crawford suggests the import and intent of knowing the natural result:
If a player character ability relies on knowing a monster's roll, a DM may say what the roll is or show it
When to know
The feat does not state when you know the roll. The implication would be knowing the roll so you can decide if you want to use the Feat, but a compromise with a DM who prefers to keep things hidden could be to show after you've chosen to use the Feat. However, I think Crawford's Tweet above implies that you should know before so as to decide whether or not the resource expenditure is worth it.