Hello S S.
I think you are looking for the wrong answer to your question. You don't want to turn a module into an extension. You want to see the generated code.
In very broad terms a module is meant to interact with people (sites and apps) while an extension is meant to interact with machines (databases, external libraries). Both generate code.
The official way is: https://success.outsystems.com/Support/Archive/11/The_Detach_Process
But this not prettier than reading decompiled code.
The generated code is optimized for processing and although it is "computer smart", it is not "human smart" so it can be hard to read. Trust the machine.