Something like this (not working code):
class LSTM(nn.Module):
    def __init__(self, initial_state):
        super(LSTM, self).__init__()

        self.lstm = nn.LSTM(
            ...
            batch_first=True)
        self.hn = initial_state
            
    def forward(self, input):
        output, hn = self.lstm(input, self.hn)
        self.hn = hn
        return output