Shares of CarGurus Inc. rallied after hours on Thursday, after the online car-buying platform offered a fourth-quarter forecast that was above expectations, as it tries to make deeper inroads with car buyers and dealers in the U.S. and internationally.