Since Drupal behaviors are really just javascript objects, all you need to do is to ensure that the behavior you're overwriting is loaded before your replacement. So:

**my_module.libraries.yml**

    some_new_lib:
      js:
        my-js-file.js: {}
      dependencies:
        - libary_with/behavior_you_want_to_override
        - core/jquery // anything else you need

**my-js.file**

    (function ($) {
  
      Drupal.behaviors.nameOfBehaviorYouWantToOverride = {
        // Your little dash of magic
      }

    })(jQuery);