To access the underlying tensor of nn.Parameter, use the data attribute:
weight.data = self.transfomer_weights(weights.data)

This will replace the value of weight while still making the nn.Parameter instance registered in the module.
Is this what you are looking for?