Maximal super Yang-Mills theories on curved background with off-shell supercharges