There are several ways to do that. Probably one of the cheaper ways is to go to a motorcycle shop, most should offer flashing LED brake lights that fit into the stock sockets. Then there are companies like
NAISSO Impala SuperStore Parts and Gift Catalog that have an item called a stop alert, which will let you adjust the flash frequency and duration.