First, /usr/share/ansible is normally where core modules are stored, so not sure what you are asking, but let me explain how loading works.
If you put a module in a library dir adjacent to a play or in a role with the same name as a 'core' module, it will override it, if that is what you are asking.
also the module path (settable in ansible.cfg or by env var) can be used to establish priority, first found will override others, so if you set a custom path before the ones shipped with ansible, they will be loaded first and override them.