Like how it is in Sublime Text. Currently I've only found the ability to show whitespace permanently.
Since version 2023.1 there is an option to enable this in the settings under Preferences | Editor | General | Appearance
.
For older version an interesting trick to get the desired effect has been posted in the feature request.
Show whitespaces
in File | Settings | Editor | General | Appearance
Text | Whitespaces
foreground color to be the same as the editor background color in File | Settings | Editor | Colors & Fonts | General
Result: Whitespace is invisible by default, but when the text is selected the background color will change and the whitespace becomes visible.