code: public MathTransform calculateLabelTransform(final CoordinateReferenceSystem mapCrs) {
          MathTransform labelTransform;
          if (this.labelProjection != null) {
              try {
                  labelTransform = CRS.findMathTransform(mapCrs, this.labelCRS, true);
              } catch (FactoryException e) {
                  throw new RuntimeException(e);
              }
          } else {
              labelTransform = IdentityTransform.create(2);
          }
  
          return labelTransform;
      }
docs: Determine which math transform to use when creating the coordinate of the label.
  
  @param mapCrs the crs of the map, used if the {@link #labelProjection} is not defined.