Overfitting: train loss continues to decrease while test/val loss increases
Underfitting: train loss remains high and doesn’t decrease(not constant). can be better determined using accuracy on train set rather than loss.
Best fit: Best to choose the weights giving high accuracy(or any metric depending on the problem) on test/val set rather than finding it with loss.
In the above graph, you can choose the weights at Early Stopping Checkpoint point.