France beat South Africa in an all-time classic to claim the inaugural Nations Championship title at Twickenham.