def _should_save_on_train_epoch_end(self, trainer: Trainer) -> bool:
        """Determine if checkpoint should be saved at training epoch end.

        Args:
            trainer (:class:`~lightning.pytorch.Trainer`): PyTorch Lightning trainer instance.

        Returns:
            bool: ``True`` if checkpoint should be saved at training epoch end, ``False`` otherwise.

        Note:
            The method follows this decision flow:

            - Returns user-specified value if ``_save_on_train_epoch_end`` is set
            - For zero/few-shot models, defaults to ``False`` (save at validation end)
            - Otherwise, follows parent class behavior
        """
        if self._save_on_train_epoch_end is not None:
            return self._save_on_train_epoch_end

        if trainer.lightning_module.learning_type in {LearningType.ZERO_SHOT, LearningType.FEW_SHOT}:
            return False

        return super()._should_save_on_train_epoch_end(trainer)
Determine if checkpoint should be saved at training epoch end.

        Args:
            trainer (:class:`~lightning.pytorch.Trainer`): PyTorch Lightning trainer instance.

        Returns:
            bool: ``True`` if checkpoint should be saved at training epoch end, ``False`` otherwise.

        Note:
            The method follows this decision flow:

            - Returns user-specified value if ``_save_on_train_epoch_end`` is set
            - For zero/few-shot models, defaults to ``False`` (save at validation end)
            - Otherwise, follows parent class behavior
        
src/anomalib/callbacks/checkpoint.py