Adding to an array & passing it through do_action/apply_filters

The basic premise for creating meta boxes from scratch is to first register a metabox, which calls a display callback that you then create and output fields in. And then of course you need to handle sanitizing, saving, and displaying that data yourself.

The class you’re using isn’t really the “WordPress-way” so much as a framework that serves to make creating meta boxes and sanitizing various types of fields easier.

If you’re interested in learning how to do it “from scratch”, here’s a very simplified example for adding a new meta box:

/**
 * Register meta box(es).
 */
function wpdocs_register_meta_boxes() {
    add_meta_box( 'meta-box-id', __( 'My Meta Box', 'textdomain' ), 'wpdocs_my_display_callback', 'post' );
}
add_action( 'add_meta_boxes', 'wpdocs_register_meta_boxes' );

/**
 * Meta box display callback.
 *
 * @param WP_Post $post Current post object.
 */
function wpdocs_my_display_callback( $post ) {
    // Display code/markup goes here. Don't forget to include nonces!
}

/**
 * Save meta box content.
 *
 * @param int $post_id Post ID
 */
function wpdocs_save_meta_box( $post_id ) {
    // Save logic goes here. Don't forget to include nonce checks!
}
add_action( 'save_post', 'wpdocs_save_meta_box' );

Of course, there’s also good information on the the add_meta_box() page in the Code Reference.