def METHOD_NAME(self, model_learnable: ModelLearnable, fl_ctx: FLContext) -> Shareable:
    """Convert ModelLearnable to Shareable.
    Args:
        model_learnable (ModelLearnable): model to be converted
        fl_ctx (FLContext): FL context
    Returns:
        Shareable: a shareable containing a DXO object.
    """
    if not self.shareable:
        # initialization or recovering from previous training
        model = model_learnable[ModelLearnableKey.WEIGHTS]
        if model:
            # recovering from previous run - distinguish between cyclic and bagging modes as
            # global model format is different
            if isinstance(model, dict):
                # bagging mode
                serialized_model = bytearray(json.dumps(model), "utf-8")
            else:
                # cyclic mode, model should be serialized already
                serialized_model = model
            dxo = DXO(data_kind=DataKind.XGB_MODEL, data={"model_data": serialized_model})
        else:
            # initial run, starting from empty model
            dxo = model_learnable_to_dxo(model_learnable)
        return dxo.to_shareable()
    else:
        # return shareable saved from previous call to shareable_to_learnable
        return self.shareable