Roger Federer secured the 1,000th victory of his career as he beat Milos Raonic to win the Brisbane International title.