If I remember correctly, what I did was to create a stack of white space in the lexer but of course that requires actions in the lexer.
Another way to handle this would be to create a character stream processor that sends Unicode 16 characters not just 8 bit to the lexer. Then, use a special bit patterns to indicate the character is actually a nesting depth. The lexer can then send INDENT and DEDENT tokens to the parser.