The U.S. stopped training factory workers decades ago, and retirements and immigration crackdowns are draining the pool of labor available.