def METHOD_NAME(
    self,
    node_class: type[_SuccessfulInferenceResultT],
    transform: TransformFn[_SuccessfulInferenceResultT],
    predicate: _Predicate[_SuccessfulInferenceResultT] | None = None,
) -> None:
    """Register `transform(node)` function to be applied on the given node.
    The transform will only be applied if `predicate` is None or returns true
    when called with the node as argument.
    The transform function may return a value which is then used to
    substitute the original node in the tree.
    """
    self.transforms[node_class].append((transform, predicate))  # type: ignore[index, arg-type]