I am able to create a custom node graph by selecting nodes and then choosing the "Compose Node Graph" option in the context menu. After that, when I select my custom node graph, I see in the top-right panel that it is possible to define inputs and outputs. However, I was not able to figure out how to link those to the inputs and outputs in the underlying nodes.
How to define parameters for custom Node Graph
I noticed that if I right-click on the node graph, in the Scene outline, there is an option "Open in Shader Graph" which allows inputs and outputs to be linked to the nodes!