I am assuming you are using a loss function like NLLLoss 3 to get the log likelihood.
criterion = nn.NLLLoss()
loss = criterion(output, target)

You can get the value of the loss using loss.item() and store it in a list or array. For a nice example on how to keep track of your loss check out this line 7 from the imagenet example.