Use class \Magento\CatalogInventory\Api\StockRegistryInterface

protected $_stockRegistry;

public function __construct(
...
\Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry
){
    $this->_stockRegistry = $stockRegistry;
}

Load item by its sku, then update it qty.

$stockItem = $this->_stockRegistry->getStockItemBySku($sku);
$stockItem->setQty($value);
$this->_stockRegistry->updateStockItemBySku($sku, $stockItem);