Override theme’s WooCommerce file

You can use the wc_get_template filter, which allows you to override the absolute filepath to a template just before it’s included. For example, this overrides checkout/payment.php:

add_filter( 'wc_get_template', function ( $file, $name ) {
    if ( $name === 'checkout/payment.php' ) {
        // $file must be an absolute filepath

        // e.g. path relative to current file
        $file = __dir__ . '/templates/checkout/payment.php';

        // e.g. path relative to parent directory
        $file = dirname( __dir__ ) . '/templates/checkout/payment.php';
    }

    return $file;
}, 10, 2 );