I’m not sure what you mean by obtain is, but you can definitely inspect, dump the weights for any layer in the transformer. If you set up for transformer model something like this:
model = Transformer(args), you can print/access he intermediate weights like this model.encoder.layers[n].self_attn.W_Q.
Of course the exact keys(encoder, self_attn, etc) would change based on how you set up your model but it’s pretty straightforward.