JavaScript (Node.js), 6356 bytes
n=>[...m=ArrayArray(n)].map((_,x,a)=>[...m]=>a.map((_,by)=>-~a>++b=>x>y++?-~a~x:by))
Outputs an array of arrays.
Thanks to Shaggy for -5 bytes
Thanks to Arnauld for further -2 bytes
JavaScript (Node.js), 7871 bytes
n=>[...m=ArrayArray(n)].map((_,x,a)=>[...m]=>a.map((_,by)=>-~a>++b=>x>y++?-~a~x:by).join``).join`
`
Outputs string
History
n=>[...Array(n)].map((_,x,a)=>a.map((_,y)=>-~x>++y?-~x:y)) // 58
n=>[...m=Array(n)].map((_,a)=>[...m].map((_,b)=>-~a>++b?-~a:b)) // 63
n=>[...(m=Array(n))].map((_,a)=>[...m].map((_,b)=>-~a>++b?-~a:b)) // 65
n=>[...(m=Array(n)).keys()].map(a=>[...m.keys()].map(b=>-~a>++b?-~a:b)) // 71