In LaTeX when using the default formatting for the table of contents, all section titles are aligned with the same vertical line no matter the width of the section number preceding it (see image below).
There could be a way to write a show rule on outline to get the desired result, but I believe it’s best to wait for contributions to be made in typst. I think there was WIP at some point.
The outrageous package has a function for this, although I think it only uses it for page numbers, not section numbers:
Still, this could be a building block for doing something similar yourself. Basically, whenever you put something that should be aligned, you use this function and it makes sure that all of the things know what the max width among them is. The displaying using that information is then your job again.