You can see https://codex.wordpress.org/Plugin_API/Action_Reference/save_post for reference.
Here is a quick example of creating/updating meta field when create/updating a page.
function save_page( $post_id, $post, $update ) {
$post_type = get_post_type( $post_id );
// If this isn't a 'page' post, don't update it.
if ( 'page' != $post_type ) return;
// Update the post's metadata.
update_post_meta( $post_id, 'content_from_page', $post->post_content );
}
add_action( 'save_post', 'save_page', 10, 3 );