Sure, actually you can instantiate the mask already in __init__, i.e.:
def __init__(self):
    ...
    self.embed = ...
    self.mask = ...
    self.mask[0,:,5] = 1
    # Don't compute the masked version of 'embed' yet.

def forward(self, x):
    embed = self.embed * mask  # don't overwrite `self.embed`
    x = torch.cat([embed,x])  # use the newly created `embed` tensor

However any operation that will create a new node in the computation graph (i.e. any operation that involves a tensor with requires_grad=True) needs to happen in forward, so that the changes to the parameters can become effective.