You can change the dilation by directly accessing the attribute:
conv = nn.Conv2d(1, 1, 3, dilation=1)
x = torch.randn(1, 1, 24, 24)
out = conv(x)
print(out.shape)
> torch.Size([1, 1, 22, 22])

conv.dilation = (2, 2)
out = conv(x)
print(out.shape)
> torch.Size([1, 1, 20, 20])

However, changing the number of output channels would change the weight parameter, since you would be adding new kernels or would remove some, so how should this be performed?