Then you could try the following:
model = nn.Sequential(
    nn.Linear(20, 10),
    nn.ReLU(),
    nn.Linear(10, 2)
)

optimizer = optim.SGD(model.parameters(), lr=1e-3)

x = torch.randn(1, 20)

# Store just the first layer
weights = {k: v.clone() for k, v in model[0].named_parameters()}
updates = {k: v.clone() for k, v in model[0].named_parameters()}

for epoch in range(10):
    optimizer.zero_grad()
    output = model(x)
    output.mean().backward()
    optimizer.step()

    new_weights = {k: v.clone() for k, v in model[0].named_parameters()}
    updates = {k: new_weights[k] - weights[k] for k in weights}
    weights = new_weights
    
    print(updates)