I believe you can use python dunder method __dict__ on any python object. If I instantiate conv2d module like this:
conv2d = nn.Conv2d(in_channels=3, out_channels=6, kernel_size=3)

Calling conv2d.__dict__ gives me this:
{'_backward_hooks': OrderedDict(),
 '_buffers': OrderedDict(),
 '_forward_hooks': OrderedDict(),
 '_forward_pre_hooks': OrderedDict(),
 '_load_state_dict_pre_hooks': OrderedDict(),
 '_modules': OrderedDict(),
 '_non_persistent_buffers_set': set(),
 '_parameters': OrderedDict([('weight', Parameter containing:
               tensor([[[[-0.0343,  0.0877, -0.1922],
                         [-0.0998,  0.0335,  0.1608],
                         [-0.0976,  0.0042,  0.0078]],
               
                       ...
               
                        [[ 0.0101,  0.1680, -0.1120],
                         [-0.0862,  0.0624, -0.0306],
                         [ 0.0852, -0.0843, -0.0521]]]], requires_grad=True)),
              ('bias', Parameter containing:
               tensor([ 0.0879,  0.0465, -0.1899, -0.1272,  0.0014,  0.0306],
                      requires_grad=True))]),
 '_reversed_padding_repeated_twice': (0, 0, 0, 0),
 '_state_dict_hooks': OrderedDict(),
 'dilation': (1, 1),
 'groups': 1,
 'in_channels': 3,
 'kernel_size': (3, 3),
 'out_channels': 6,
 'output_padding': (0, 0),
 'padding': (0, 0),
 'padding_mode': 'zeros',
 'stride': (1, 1),
 'training': True,
 'transposed': False}

If you need, you can filter out parameters which are starts with _