I am migrating m1 code to m2, below is the code i used in m1 to get eav collection.

      $customerattrs = Mage::getModel('eav/entity_attribute')->getCollection();
        $customerattrs->addFieldToFilter('is_user_defined', 1);
        $customerattrs->addFieldToFilter('entity_type_id', Mage::getModel('eav/entity')->setType('customer')->getTypeId());

  how this can be used in magento2?