I think this use case should be possible if you make sure the shapes are as expected.
Here is a small example, which concatenates a new tensor to the internal buffer and checks that it’s also added to the state_dict:
class MyModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.register_buffer('a', torch.ones(1, 1))

    def forward(self, x: torch.Tensor, extend: bool):
        if extend:
            new_tensor = torch.randn(1, 1)
            self.a = torch.cat([self.a, new_tensor], dim=0)
        return x

model = MyModel()
x = torch.randn(1, 1)

for _ in range(10):
    out = model(x, extend=True)
    print(model.state_dict())