Tim Cook has sent his final memo as Apple CEO, ending a 15-year tenure as John Ternus inherits a $4.7 trillion company facing major AI tests.