Zend certified PHP/Magento developer

create custom module, get existing module configuration

I would like to create a customer module, I want to get use with the vendor/magento/module-ups/ module, and using the same config in my custom module, such as userID, password, access key. how can I include into my custom module? I want to get use below function into my custom module. Please advise.

    protected function setXMLAccessRequest()
    {
        $userId = $this->getConfigData('username');
        $userIdPass = $this->getConfigData('password');
        $accessKey = $this->getConfigData('access_license_number');

        $this->_xmlAccessRequest = <<<XMLAuth
<?xml version="1.0" ?>
<AccessRequest xml:lang="en-US">
  <AccessLicenseNumber>$accessKey</AccessLicenseNumber>
  <UserId>$userId</UserId>
  <Password>$userIdPass</Password>
</AccessRequest>
XMLAuth;
    }