code: def should_store_best_checkpoint(self, epoch_idx, metrics) -> bool:
          
          if not self.store_best:
              return False
  
          metric = metrics[self.metric]
  
          if better(self._current_best_metric_value, metric, self.metric_mode):
              self._current_best_metric_value = metric
              return True
  
          return False
docs: Should we store current checkpoint as the best