You can put prints everywhere you want to debug. The ONNX serializer traces the model, so it will execute it once, take a look at the documentation 19 for more details.
Here is a snippet showing how you could debug:
import torch
class Conv(torch.nn.Module):
	def __init__(self):
		super(Conv, self).__init__()
		self.conv = torch.nn.Conv2d(3, 7, 5, 1, 2)
	def forward(self, x):
		print("-" * 40)
		print("DEBUG forward BEFORE convolution")
		print("-" * 40)
		x = self.conv(x)
		print("-" * 40)
		print("DEBUG forward AFTER convolution")
		print("-" * 40)
		return x

model = Conv()
dummy_input = torch.rand(16, 3, 100, 100)
torch.onnx.export(model, dummy_input, "debug.onnx", verbose=True)